export default {
  name: "protocolinfo-item-manage",
  data() {
    return {
      isActive: 1,
      focuses: [
        { focus: "settlement-list" }, //全部
        { focus: "settlement-list-pending" }, //待审批
        { focus: "settlement-list-approvaled" } //已审批
      ],
      // 非锁定表格
      unfixedTableThead: [
        {
          label: "审批类型",
          prop: "todoData.businessBillTypeName",
          width: "100"
        },
        {
          label: "结算单名称",
          prop: "businessData.settlementName",
          width: "180"
        },
        {
          label: "填报单位",
          prop: "businessData.reportInOrgName",
          width: "200"
        },
        {
          label: "合同编号",
          prop: "businessData.contractCode",
          width: "130"
        },
        {
          label: "合同正式编号",
          prop: "businessData.formalContractCode",
          width: "130"
        },
        {
          label: "合同名称",
          prop: "businessData.contractName",
          width: "150"
        },
        {
          label: "供应商",
          prop: "businessData.supplierName",
          width: "200"
        }, 
        {
          label: "结算数量",
          prop: "businessData.currSetCount",
          width: "80"
        }, 
        {
          label: "结算金额",
          prop: "businessData.currSetMoneyString",
          width: "100",
          align: "right",
        },
        {
          label: "编制人",
          prop: "businessData.reportUsername",
          // align: "right",
          width: "80"
        },
        {
          label: "编制日期",
          prop: "businessData.createTime",
          width: "100",
          check: true,
          // formatterName: "wirteTimeHandler"
        },
        {
          label: "审批状态",
          prop: "todoData.workItemStatusString",
          width: "100"
        }
      ],
      businessBillType: {
        S0301: "结算录入",
        S0302: "结算冲销"
      },
      bizStatusType: {
        // 2:"编辑中",
        // 3:"待审批",
        // 4:"已撤回",
        // 5:"审批通过",
        // 6:"审批退回",
        // 7:"审批不通过",
        // 9:"已生效",
        // 11:"已删除",
        // 21:"冲销中",
        // 22:"已冲销"
        '1':"审批中",  
        '2':"已撤回",  
        '3':"审批通过",  
        '4':"审批退回",  
        '5':"审批不通过",
      },
      settlementapprovalType:{
        0:"待审批",
        1:"已审批"
      }
    };
  },
  methods: {
    // 页签跳转
    tabChange(data, index) {
      console.log("tab:", data);
      this.$router.push(`/settlement-management/settlementApproval/${data}`);
    },
    goApproval(row, index) {
      console.log(row);
      const { businessData, todoData } = row;
      this.$store.dispatch("setBusinessList", todoData);
      const businessList = JSON.stringify(todoData);
      sessionStorage.setItem("businessList", businessList);
      const businessDataList = JSON.stringify(businessData);
      sessionStorage.setItem("businessDataList", businessDataList);
      if (row.todoData.businessBillTypeCode == "S0301") {
        this.$router.push(
          `/settlement-management/settlementApproval/settlement-approval/${businessData.id}`
        );
      } else if (row.todoData.businessBillTypeCode == "S0302") {
        this.$router.push(
          `/settlement-management/settlementApproval/settlement-written-off-approval/${businessData.id}`
        );
      }
    }
  },
};
